Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
fit-file-parser
Advanced tools
Parse your .FIT files easily, directly from JS (Garmin, Polar, Suunto)
Parse your .FIT files easily, directly from JS. Written in ES6. (Hope to change)
$ npm install fit-file-parser --save
See in examples folder:
// Require the module
var FitParser = require('./../dist/fit-file-parser.js').default;
// Read a .FIT file
var fs = require('fs');
fs.readFile('./example.fit', function (err, content) {
// Create a FitParser instance (options argument is optional)
var fitParser = new FitParser({
force: true,
speedUnit: 'km/h',
lengthUnit: 'km',
temperatureUnit: 'kelvin',
pressureUnit: 'bar', // accept bar, cbar and psi (default is bar)
elapsedRecordField: true,
mode: 'cascade',
});
// Parse your file
fitParser.parse(content, function (error, data) {
// Handle result of parse method
if (error) {
console.log(error);
} else {
console.log(JSON.stringify(data));
}
});
});
Needed to create a new instance. options is optional, and is used to customize the returned object.
Allowed properties :
mode
: String
cascade
: Returned object is organized as a tree, eg. each lap contains a records
fields, that is an array of its records (default)list
: Returned object is organized as lists of sessions, laps, records, etc..., without parent-child relationboth
: A mix of the two other modes, eg. records
are available inside the root field as well as inside each lapslengthUnit
: String
m
: Lengths are in meters (default)km
: Lengths are in kilometersmi
: Lengths are in milestemperatureUnit
: String
celsius
:Temperatures are in °C (default)kelvin
: Temperatures are in °Kfahrenheit
: Temperatures are in °FspeedUnit
: String
m/s
: Speeds are in meters per seconds (default)km/h
: Speeds are in kilometers per hourmph
: Speeds are in miles per hourforce
: Boolean
true
: Continues even if they are errors (default for now)false
: Stops if an error occurselapsedRecordField
: Boolean
true
: Includes elapsed_time
, containing the elapsed time in seconds since the first record, and timer_time
, containing the time shown on the device, inside each record
fieldfalse
(default)callback receives two arguments, the first as a error String, and the second as Object, result of parsing.
All started thanks to Pierre Jacquier
Big thanks to Mikael Lofjärd for his early prototype. See CONTRIBUTORS.
MIT license; see LICENSE.
(c) 2019 Dimitrios Kanellopoulos
FAQs
Parse your .FIT files easily, directly from JS (Garmin, Polar, Suunto)
We found that fit-file-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.